package jgl.vajra.driver.widget.loopviewpage;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

/**
 * @since 1.0  2016/07/17
 */
public class AutoSwitchView extends AutoLoopSwitchBaseView {

    public AutoSwitchView(Context context) {
        this(context, null);
    }

    public AutoSwitchView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public AutoSwitchView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);

    }

    public AutoSwitchView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }


    @Override
    protected void onSwitch(int index, Object o) {

    }

    @Override
    protected View getFailtView() {
        return null;
    }

    @Override
    protected long getDurtion() {
        return durtion;
    }

    public void setDurtion(long durtion) {
        this.durtion = durtion;
    }

    private long durtion = 3000;

    @Override
    public void setAdapter(AutoLoopSwitchBaseAdapter adapter) {
        super.setAdapter(adapter);
        if (mHandler != null)
            mHandler.sendEmptyMessage(LoopHandler.MSG_REGAIN);
        // mHandler.sendEmptyMessage(LoopHandler.MSG_START);


    }

    public void setFocusable(boolean f) {
        mViewPager.setFocusable(f);
    }
}